package com.czp.infosharingplatformapp.repository;

import com.czp.infosharingplatformapp.model.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface CategoryRepository extends JpaRepository<Category, Long> {
    // 查找所有一级分类
    List<Category> findByParentIsNull();
    // 查找某个分类的子分类
    List<Category> findByParent(Category parent);
}